<div class="modal-header">
    <h3 class="modal-title">Playbook配置</h3>
</div>
<div class="modal-body">
    <form class="bs-example form-horizontal">

        <div class="form-group">
            <div class="col-md-6">
                <label class="col-lg-4 control-label"><span style="color: #ec2121;">*</span>服务器组名称</label>
                <div class="col-lg-8">
                    <ui-select ng-model="nowServerGroup.selected" theme="bootstrap"
                               ng-change="changeServerGroup()">
                        <ui-select-match placeholder="搜索服务器组名称......">{{$select.selected.name}}</ui-select-match>
                        <ui-select-choices refresh="queryServerGroup($select.search)" refresh-dalay="0"
                                           repeat="item in serverGroupList | filter: $select.search">
                            <div ng-bind-html="item.name | highlight: $select.search"></div>
                        </ui-select-choices>
                    </ui-select>
                </div>
            </div>

            <div class="form-group" ng-show="hostPatternList != null && hostPatternList.length != 0">
                <div class="col-md-6">
                    <label class="col-lg-4 control-label"><span style="color: #ec2121;">*</span>HostPattern</label>
                    <div class="col-lg-8">
                        <!--ng-change="hostPatternSelected()"-->

                        <select class="form-control" ng-model="nowHostPattern.selected"
                                ng-options="hp as hp.hostPattern for hp in hostPatternList" required>
                            <option value="">--请选择--</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-12">
                <label class="col-md-2 control-label">服务器列表</label>
                <div class="col-md-10" style="box-shadow: 0 0 5px #ddd;padding: 10px">
                    <div class="col-md-6" ng-repeat="server in nowHostPattern.selected.servers">
                        <b style="margin-left: 5px; color: #286090">
                            {{server.serverName}}-{{server.serialNumber}}({{server.insideIp}})</b>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-12">
                <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>配置文件</label>
                <div class="col-lg-10">
                    <select class="form-control" ng-model="nowConfigFile.selected"
                            ng-options="configFile as configFile.fileName + '<' +configFile.fileDesc + '>' for configFile in configFileList" required>
                        <option value="">--请选择--</option>
                    </select>
                </div>
            </div>
        </div>


        <div class="form-group">
            <div class="col-md-12">
                <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>Src(源路径)</label>
                <div class="col-lg-10">
                    <input type="text" class="form-control" placeholder="源路径" ng-model="nowConfigFile.selected.filePath" readonly>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>Dest(目标路径)</label>
            <div class="col-lg-10">
                <input type="text" class="form-control" placeholder="目标路径" ng-model="item.dest">
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-12">
                <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>Playbook</label>
                <div class="col-lg-10">
                    <select class="form-control" ng-model="nowPlaybook.selected"
                            ng-options="playbook as playbook.scriptName + '<' + playbook.content + '>' for playbook in playbookList" required>
                        <option value="">--请选择--</option>
                    </select>
                </div>
            </div>
        </div>
        <!--<div class="form-group">-->
            <!--<div class="col-md-6">-->
                <!--<label class="col-lg-4 control-label">Owner</label>-->
                <!--<div class="col-lg-8">-->
                    <!--<input type="text" class="form-control" placeholder="目标文件的权限owner" ng-model="item.username">-->
                <!--</div>-->
            <!--</div>-->
            <!--<div class="col-md-6">-->
                <!--<label class="col-lg-4 control-label">Group</label>-->
                <!--<div class="col-lg-8">-->
                    <!--<input type="text" class="form-control" placeholder="目标文件的权限group" ng-model="item.usergroup">-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->

        <div class="form-group" style="text-align:center;">

            <!--保存-->
            <button ng-click="saveItem()"
                    class="btn btn-xs"
                    style="margin-left: 5px; background-color: #2e6da4; color: white;">
                <span class="glyphicon glyphicon-ok"></span>保存
            </button>


        </div>
    </form>
    <div ng-if="alert.type != ''">
        <div uib-alert ng-class="'alert-' + alert.type" close="closeAlert()">{{alert.msg}}</div>
    </div>
</div>